package com.suxin.invocation;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Classname invocation
 * @Description [ TODO ]
 * @Author Tang
 * @Date 2020/11/21 17:22
 * @Created by ASUS
 */
public class MyInvocation implements InvocationHandler {

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        // 执行的是Object方法
        if (Object.class.equals(method.getDeclaringClass())) {
            return method.invoke(this,args);
        }
        System.out.println( "执行方法了...." );
        return proxy;
    }
}